import javax.swing.JButton;

/**
 * Single instance of a land button. Extends JButton and implements the
 * standard Java Serializable class.
 * 
 * @author GT Five-O
 * @version v1.0b
 *
 */
public class LandButton extends JButton implements java.io.Serializable {
    private Property p;

    /**
     * Setter for the text of the landButton.
     * 
     * @param text
     *            The text of the land-button.
     */
    public LandButton(String text) {
        setText(text);
    }

    /**
     * sets the property of the button.
     * 
     * @param p
     *            The property that the land is being set to.
     */
    public void setProperty(Property p) {
        this.p = p;
    }

    /**
     * Get's mules on property.
     * 
     * @return Mule on property.
     */
    public Mule getPropertyMule() {
        return p.getMule();
    }

    /**
     * Getter for the button's property.
     * 
     * @return Property value.
     */
    public Property getProperty() {
        return p;
    }

    /**
     * Getter for the property's food production.
     * 
     * @return Property's food production.
     */
    public int getFoodRate() {
        return p.getFoodInfo();
    }

    /**
     * Getter for the property's energy production.
     * 
     * @return Property's energy production.
     */
    public int getEnergyRate() {
        return p.getEnergyInfo();
    }

    /**
     * Getter for the production of the property's ore.
     * 
     * @return Property's ore production.
     */
    public int getOreRate() {
        return p.getOreInfo();
    }

    /**
     * Getter for the name of the property.
     * 
     * @return Name of property.
     */
    public String getPropertyName() {
        return p.getName();
    }
}
